import datetime
from applications.extensions import db


class Dept(db.Model):
    __tablename__ = 't_dept'
    id = db.Column(db.Integer, primary_key=True, comment="部门ID")
    code = db.Column(db.String(32), comment="部门编号")
    parent_id = db.Column(db.Integer, comment="父级id")
    dept_name = db.Column('name', db.String(32), comment="部门名称")
    # sort = db.Column(db.Integer, comment="排序")
    leader = db.Column('contact', db.String(32), comment="负责人")
    phone = db.Column(db.String(32), comment="联系方式")
    remark = db.Column(db.String(32), comment="备注")
    create_at = db.Column(db.DateTime, default=datetime.datetime.now, comment='创建时间')
    update_at = db.Column(db.DateTime, default=datetime.datetime.now, onupdate=datetime.datetime.now, comment='修改时间')
